package com.hqyj.springBoot.modules.test.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hqyj.springBoot.modules.common.entity.AbstractEntity;

import javax.persistence.*;

@Entity
@Table(name = "test_card")
public class Card extends AbstractEntity {
    private String cardNo;

    //没有外键的一方,使用mappedBy标注另一方关联属性名
    @OneToOne(mappedBy = "studentCard")
    @JsonIgnore//不查学生对象
    private Student student;

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

}
